// JavaScript Document
var D=new Function('obj','return document.getElementById(obj);')
function htmlbody(){
return (
document.documentElement.clientHeight<=document.body.clientHeight
&&document.documentElement.clientHeight!=0
)
?document.documentElement:document.body;
}
function scrollLeft(){return (!window.pageYOffset)?htmlbody().scrollLeft:window.pageXOffset;}
function scrollTop(){return (!window.innerHeight)?htmlbody().scrollTop:window.pageYOffset;}

function getleft(strobjs,strLeftType,strleft){
	var temp_getleft = 0;
	if (strLeftType=="left"){
		temp_getleft = scrollLeft()*1 + strleft*1;
	}else if (strLeftType=="mid"){
		(strleft*1<0)
		?temp_getleft = scrollLeft()*1 + strleft*1
		+ htmlbody().clientWidth*1/2 - strobjs.offsetWidth*1
		:temp_getleft = (scrollLeft()*1+strleft*1 + htmlbody().clientWidth*1/2);
	}else if (strLeftType=="right"){
			temp_getleft 
			= scrollLeft()*1 + htmlbody().clientWidth*1 
			- strleft*1 - strobjs.offsetWidth*1;
	}
	return temp_getleft;
}

function moveTips(strobj,theTop,theLeft,theLeftType) {
	var old,nowobj = D(strobj);
	var nowleft = nowobj.style.left.replace("px","")*1;
	var temp_left = getleft(nowobj,theLeftType,theLeft);
	var re_theTop = theTop;
	if (temp_left!=nowleft){
		(Math.abs(temp_left-nowleft)>3&&Math.abs(temp_left-nowleft)<600)
		?((temp_left>nowleft)?nowleft += Math.abs(temp_left-nowleft)/5
		:nowleft -= Math.abs(temp_left-nowleft)/5)
		:nowleft = temp_left;
		nowobj.style.left = nowleft + "px";
	}
	if (!openweb){old = re_theTop;var openweb;};
  var pos,tt=50;
  pos = scrollTop()*1-nowobj.offsetTop*1+re_theTop*1;
  pos = nowobj.offsetTop+pos/10;
  if (pos < re_theTop) pos = re_theTop;
  if (pos != old) {nowobj.style.top = pos+"px";tt=5;}
  old = pos;
  setTimeout("moveTips('"+strobj+"','"+theTop+"','"+theLeft+"','"+theLeftType+"')",tt);
}
function checkss(so,n,msg)
{
	var preSo = msg;
	if (n == 0 && so.value == preSo )
	{
		so.value="";
		return true;
	}
	if (n == 1)
	{
		if(so.value == preSo )
		{
			so.value="";
		}
		return true;
	}
	if (n == 2 && so.value == "")
	{
		so.value = preSo;
		return true;
	}
	return true;
}